@extends('layouts.accounts')

@section('content')
    @include('web.accounts.header')
    <style>
        #sendCodeForm .fc-inline{display: block;margin-bottom: 10px;}
        #sendCodeForm .fc-inline strong{display: inline-block;width: 10%;*display: inline;*zoom: 1;}
        #sendCodeForm .fc-inline span{display: inline-block;width: 10%;*display: inline;*zoom: 1; color: red;}
        #sendCodeForm .fc-inline input[type=text]{width: 200px;height: 24px;line-height: 24px;}
        #span-ren{color: red}
        #sp-time{color:red}
        #select-box strong{display: inline-block;width: 3%;*display: inline;*zoom: 1;}
        #select-box strong+strong{text-align: center;}
        #select-box select{width: 10%;padding: 7px 4px;}
    </style>
    <i class="i_mng_side_bg"></i>
    <div id="manage_wrap" class="clearfix">
        @include('web.accounts.siderbar')
        <div class="manage_wrap">
            <div class="s_cert_wrap">
                @if($phonekey==2)
                        <label class="fc-inline mr20 mt20">
                            <strong>手机号码:{{$phone}} </strong>
                        </label>
                        <label class="fc-inline mr20 mt20">
                            <span style="padding: 5px 10px;background: #d20534;color:#fff;border-radius: 6px;" class="s_status off">已绑定</span>
                        </label>
                    @elseif($phonekey==1)
                    @if(session('phonecode')==null)
                        <form id="sendCodeForm" action="" method="post">
                            {{ csrf_field() }}
                            <label class="fc-inline">
                                <strong>未绑定手机: </strong>
                                <input sync-target="#sendCodePhone" pattern="^1[345678][0-9]{9}$" data-message="手机号码格式不正确"
                                       required="required" name="telphone" maxlength="11" placeholder="手机号码" class="fc" type="text"
                                       value="{{$phone}}">
                            </label>
                            <label class="fc-inline">
                                <strong style="height: 36px;line-height: 36px;float: left">验证码: </strong>
                            <span class="s_l" style="float: left;margin-left: 4px;">
                                <img src="{{captcha_src()}}" id="captcha_send_msg"
                                     onclick="this.src='{{captcha_src()}}?' + new Date().getTime()" title="换一张">
                            </span>
                                <div class="clearfix"></div>
                            </label>
                            <label class="fc-inline">
                                <strong>输入图片验证码: </strong>
                                <input required="required" placeholder="请输入图片验证码" maxlength="5" name="captcha" type="text"
                                       value="">
                            </label>
                            @if ($errors->has('captcha'))
                                <span>{{$errors->first('captcha',':message')}}</span>
                            @endif
                            <button type="submit" class="bt bt_block">发送短信验证码</button>
                        </form>
                    @else
                        <form action="/accounts/chkcode" method="post">
                            {{ csrf_field() }}
                            <label class="fc-inline mr20 mt20">
                                <strong>短信验证码: </strong>
                                <input  name="phonecode"  type="text" value="">
                                <input  name="cphone"  type="hidden" value="{{$phone}}">
                                @if ($errors->has('phonecode'))
                                    <span>{{$errors->first('phonecode',':message')}}</span>
                                @endif
                                @if(session('msg'))
                                    <span>验证码错误</span>
                                @endif
                                <button type="submit" class="bt bt_block">进行手机绑定</button>
                            </label>

                        </form>
                        <a    href="javascript:;" class="fs12">短信验证码已经发送，请你在5分钟之内尽快查看</a>
                   @endif
                @endif

            </div>
        </div>
    </div>
@endsection